<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags/components" %>

<!-- Author: Minh-Tuan Ta -->

<div id="messagesDiv">
	<div id="messagesNav">
		<ul>
			<li <c:if test="${location == 'inbox' }">class="currentMessagesLocation"</c:if>><a href="Messages?action=messages&location=inbox">Inbox (<span class="<c:if test="${numOfUnreadMessages > 0 }">hasNew</c:if>">${numOfUnreadMessages }</span>)</a></li>
			<li <c:if test="${location == 'outbox' }">class="currentMessagesLocation"</c:if>><a href="Messages?action=messages&location=outbox">Outbox</a></li>
		</ul>
	</div>
	
	<div id="messagesContent">
		<c:if test="${action == 'messages' }">
			<c:forEach var="message" items="${messages }">
				<myTags:MessageLine location="${location }" message="${message}"></myTags:MessageLine>
			</c:forEach>
		</c:if>
		<c:if test="${numOfUnreadMessages < 1 }">
			<h3>You have no messages. Do you want to create one?</h3>
		</c:if>
		<c:if test="${action == 'viewMessage' }">
			<myTags:MessageFull message="${message}" location="${location }"></myTags:MessageFull>
		</c:if>
	</div>
	
</div>